﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core.Rules
{
    /// <summary>
    /// check if the question marked as "solved"
    /// </summary>
    public class Solved_Rule : IRule
    {
        public double apply( SiteEnum site, QuestionInformation info)
        {
            if (!info.Question.AnsweredMark.HasValue) return 0; // if a site does not provide a "solved" field
            return info.Question.AnsweredMark.Value ? 1 : 0; // if a mark is here - return positive infinity
        }

        public string RuleName
        {
            get { return "Solved_Rule"; }
        }
    }
}
